package org.fastiot.data

import grails.testing.gorm.DomainUnitTest
import spock.lang.Specification

class DataSetSpec extends Specification implements DomainUnitTest<DataSet> {

    def setup() {
    }

    def cleanup() {
    }

    void "Test a valid properties"() {
        given:
        def instance = new DataSet(code: code, name: name, scene: scene, remark: remark)

        when:
        instance.save(flush: true)

        then:
        !instance.hasErrors()

        where:
        code << ["VCU", "Motor&MCU"]
        name << ["整车数据", "电机及电机控制器"]
        scene << [DataSet.AggregateScene.RealTime, DataSet.AggregateScene.TimeSharing]
        remark << [null, "单元测试数据"]
    }
}
